import request from '@/utils/request'
export function getemployees() {
  return request({
    url: '/sys/user/simple',
    method: 'GET'
  })
}

export function getsyslist(params) {
  return request({
    url: '/sys/user',
    method: 'GET',
    params
  })
}

export function importEmploy(data) {
  return request({
    url: '/sys/user/batch',
    method: 'POST',
    data
  })
}

export function delEmploy(id) {
  return request({
    url: `/sys/user/${id}`,
    method: 'delete'
  })
}
export function setsyslist(data) {
  return request({
    url: '/sys/user',
    method: 'POST',
    data
  })
}

export function saveUserDetailById(data) {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data
  })
}
export function getUserDetail(id) {
  return request({
    url: `/employees/${id}/personalInfo`,
    method: 'GET'
  })
}

/** *
 *  读取用户私人的
 * **/
export function getPersonalDetail(id) {
  return request({
    url: `/employees/${id}/personalInfo`
  })
}

/** *
 *  更新用户私人的
 * **/
export function updatePersonal(data) {
  return request({
    url: `/employees/${data.userId}/personalInfo`,
    method: 'put',
    data
  })
}
export function getJobDetail(id) {
  return request({
    url: `/employees/${id}/jobs`
  })
}

/**
 * 保存岗位信息
 * ****/
export function updateJob(data) {
  return request({
    url: `/employees/${data.userId}/jobs`,
    method: 'put',
    data
  })
}
